package TEST;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import Server.Game.Questions.Question;
import Server.Game.Questions.RightAnswer;
import Server.Game.Questions.WrongAnswer;

public class QuestionTest {
	Question q;
	RightAnswer a;
	WrongAnswer b;
	RightAnswer c;

	@Before
	public void setUp() {
		q = new Question();
		q.setContent("ANTS");
		a = new RightAnswer("Oige");
		b = new WrongAnswer("Vale");
		q.addAnswer(a);
		q.addAnswer(b);
		c = new RightAnswer("Mina_Puudun");
	}

	@Test
	public void getContentTest() {
		assertEquals("ANTS", q.getContent());
	}

	@Test
	public void addAnswerTest() {
		assertTrue(q.getAnswers().contains(a));
		assertTrue(q.getAnswers().contains(b));
		assertFalse(q.getAnswers().contains(c));
	}
	
	@Test
	public void wrongOrRightAnswerTest(){
		assertTrue(q.wrongOrRightAnswer("Oige"));
		assertFalse(q.wrongOrRightAnswer("Vale"));
	}
	
	@Test
	public void notChangeQuestionTest(){
		assertFalse(q.changeQuestion());
	}
	
	@Test
	public void changeQuestionTest(){
		q.getAnswers().remove(a);
		assertTrue(q.changeQuestion());
	}

}
